<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>权限管理</title>
<#include "../common/link.ftl"/>
    <script>
        $(function () {
            $('.btn-reload').click(function () {
                //确认
                $.messager.confirm("温馨提示","您确定重新加载权限吗",function () {
                    $.get("/permission/reload.do",function (data) {
                        if(data.success){
                            $.messager.alert("温馨提示","准备跳转,3s后跳回去了喔");
                            //2s后自动关闭
                            setTimeout(function () {
                                //刷新本页面
                                window.location.reload()
                            },3000);
                            alert("恭喜操作成功")
                        }else {
                            $.messager.alert("温馨提示",data.msg);
                        }
                    })
                })
                //发请求
            })
        })

    </script>


    
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<#include "../common/navbar.ftl"/>
    <!--菜单回显-->
<#assign currentMenu="permission"/>
<#include "../common/menu.ftl"/>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>权限管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/permission/list.do" method="post">
                <#--分页查询的关键-->
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <a href="javascript:;" class="btn btn-success btn-reload" style="margin: 10px">
                        <span class="glyphicon glyphicon-plus"></span> 重新加载
                    </a>
                </form>
                <!--编写内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>权限名称</th>
                            <th>权限表达式</th>
                        </tr>
                    <#--list,要遍历的集合 as 变量-->
                    <#list pageResult.list as entity>
                        <tr>
                        <#--从0开始,需要加1-->
                            <td>${entity_index + 1}</td>
                            <td>${entity.name}</td>
                            <td>${entity.expression}</td>
                        </tr>
                    </#list>
                    </table>
                    <!--分页-->
                <#include "../common/page.ftl"/>
                </div>
            </div>
        </section>
    </div>
<#include "../common/footer.ftl"/>
</div>

</body>
</html>

